<template>
  <div id="UEditor">
    <script id="editor" type="text/plain"></script>
  </div>
</template>

<script type="text/ecmascript-6">
  export default {
    name: 'UEditor',
    data () {
      return {
        editor: null
      }
    },
    props: {
      defaultMsg: {
        type: String
      },
      config: {
        type: Object
      }
    },
    mounted () {
      const _this = this
      /* global UE:true */
      _this.editor = UE.getEditor('editor', _this.config)
    },
    methods: {
      getUEContent () {
        return this.editor.getContent()
      }
    },
    destroyed () {
      this.editor.destroy()
    }
  }
</script>

<style lang="less" ref="stylesheet/less" scoped>
</style>
